package finalproject.controller.commands;

import finalproject.model.player.Player;
import finalproject.view.StringManager;

/**
 * The help command
 * @author Buisson Kevin
 *
 */
public class HelpCommand extends Command {

	/**
	 * 
	 * @param player The player issuing the command
	 * @param args the argument of the command
	 */
	public HelpCommand(Player player, String[] args)
	{
		super(player, args);
	}

	@Override
	public boolean process()
	{
		// Description
		StringBuilder helpBuilder = new StringBuilder(StringManager.getString("lostaround") + "\n");

		// Add current room
		helpBuilder.append(StringManager.getString("youarein") + " " + getPlayer().getCurrentRoom() + "\n");

		// Add all commands
		helpBuilder.append(StringManager.getString("commands") + "\n");
		for (String command : Command.COMMANDS)
			helpBuilder.append(command).append(' ');

		// Display help
		StringManager.outPutText(helpBuilder.toString());
		return false;
	}
}
